#!/bin/bash

echo "" > .commit_counts.data

total=0
function search {
    added=`hg log -M | grep -i "$1" | grep "^user:" | wc -l`
    total=$(($total+$added))
    echo "$added  - $1" >> .commit_counts.data
}

search 'donovan'
search 'stein'
search 'allen'
search 'kellen'
search 'philo'
search 'gary'
search 'andrew'

echo "$total - non-merge commits understood" >> .commit_counts.data

sort -nr .commit_counts.data